Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP_SmartAudio: fix a bug that would starve the lower priority thread #19579

Merged
merged 1 commit into from
Dec 21, 2021

Conversation

MingchenZhang
Copy link
Contributor

Issue: when using smartaudio, lua script only get to run once right after a change to the vtx setting. Usually scheduled update in lua script does not run normally.

In the original code, if the smartaudio is initialized, and no other request is issued, delay() would not be executed in the loop and lower priority thread would be starved.
Change to OR to allow thread yield when no response is expected.

roughly tested with a smartaudio enabled arduplane.

@tridge
Copy link
Contributor

tridge commented Dec 20, 2021

@andyp1per looks like this should be included in 4.1.x updates?

@andyp1per
Copy link
Collaborator

looks like this should be included in 4.1.x updates?

Yeah, probably.

@tridge
Copy link
Contributor

tridge commented Dec 21, 2021

@MingchenZhang really good catch!

@rmackay9
Copy link
Contributor

Yes, @MingchenZhang really great work, txs for this!

@tridge tridge merged commit 3e60747 into ArduPilot:Plane-4.1 Dec 21, 2021
@MingchenZhang
Copy link
Contributor Author

Thanks for the quick review.
A quick question: I'm not sure how the branches are managed here. Would this branch Plane-4.1 be merged back into master? or there would need to be another pr to change this on master?

@rmackay9
Copy link
Contributor

@MingchenZhang,

In general we first merge to master and then backport to the stable releases if the "Projects" label on the right side of this screen has been set. We've set the "Projects" to Copter, Rover, Plane-4.1 so it'll be backported in the near future.

@MingchenZhang
Copy link
Contributor Author

@rmackay9 It might be my mistake, this pr merge into Plane-4.1 directly, not to master as you suggested as the general approach. This change is missing on master.

@rmackay9
Copy link
Contributor

@MingchenZhang, ah, right again! thanks very much for that. I've just directly cherry-picked it into master.

@rmackay9 rmackay9 added this to 4.1.3-rc2 in Copter 4.1 Dec 21, 2021
@tridge tridge added this to Done in Plane 4.1 Jan 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Copter 4.1
4.1.3-rc2
Rover 4.1
Awaiting triage
Development

Successfully merging this pull request may close these issues.

None yet

5 participants